package com.ihunanren.taobao.module.screen;

import static com.google.common.base.Strings.isNullOrEmpty;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.ihunanren.common.SafeConvert;
import com.ihunanren.common.auth.DES;
import com.ihunanren.taobao.CouponsReason;

/**
 * @author kalman03
 */
public class CouponsNav {

	public void execute(@Param(name="reason",defaultValue = "-1") String reason, Context context)
			throws Exception {
		
		String _reason = CouponsReason.getReasonByKey(SafeConvert.toInt(reason, -1));
		if(! isNullOrEmpty(_reason)){
			context.put("reason", _reason);
		}
		
		String time = DES.encrypt(String.valueOf(System.currentTimeMillis()),DES.DEFAULT_KEY);
		context.put("time", time);
	}
}
